// 基于template/src/views/{{appModules}}/{{pages@DEREDIRECTVIEW}}/{{spinalCase page.codeName}}-hook.ts.hbs生成
import { QXEvent } from 'qx-util';
import {
	DERedirectViewActionType,
	DERedirectViewController,
	IDERedirectViewAbility,
	IDERedirectViewControllerParams,
	IParam,
	IViewEvent,
} from '@/core';
import {
	useDERedirectViewProps,
	useDERedirectViewBasic,
	useDERedirectViewControllerParams,
    useDERedirectViewAction,
} from '@/hooks/view/use-redirect-view';
import { model } from "./ibizbook-redirect-view-model";

/**
 * 获取输入参数
 *
 * @export
 * @return {*}
 */
export function useProps() {
	return {
		...useDERedirectViewProps()
	};
}

/**
 * 获取基础数据
 *
 * @export
 * @param {*} props
 * @return {*}
 */
export function useBasic(props: any) {
	return {
		...useDERedirectViewBasic(model, props)
	};
}

/**
 * 获取行为
 *
 * @export
 */
export function useAction(controller: any) {
	return {
        ...useDERedirectViewAction(controller)
    }
}

/**
 * 获取控制器
 *
 * @export
 * @param {IParam} props
 * @param {QXEvent<IViewEvent<DERedirectViewActionType, IDERedirectViewAbility>>} evt
 * @return {*}
 */
export function useController(
	props: IParam,
	evt: QXEvent<IViewEvent<DERedirectViewActionType, IDERedirectViewAbility>>
) {
	const params: IDERedirectViewControllerParams<
		DERedirectViewActionType,
		IDERedirectViewAbility
	> = useDERedirectViewControllerParams(model, props, evt);
	return new DERedirectViewController(params);
}